﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntityComponentSystem.Framework.Systems
{
    public abstract class EntitySystem : IEntitySystem
    {
        private List<int> entities = new List<int>();

        public void AddEntity(int entity)
        {
            entities.Add(entity);
        }

        public void RemoveEntity(int entity)
        {
            entities.Remove(entity);
        }

        public abstract string Name { get; }

        public virtual void Update(GameEngine ge)
        {
            foreach (var entity in entities)
                ProcessEntity(ge, entity);
        }

        public virtual void Init(GameEngine ge)
        {

        }

        protected abstract void ProcessEntity(GameEngine ge, int entity);
    }
}
